[qt] Display the text according to QTextedit

Posted by sterh on Stack Overflow See other posts from Stack Overflow or by sterh
Published on 2010-03-15T04:53:16Z Indexed on 2010/03/15 4:59 UTC
Read the original article Hit count: 263

Filed under:

Hi to all, in this question i asked how to split text by whitespace, now i split it, but now i can't display this text in QTextEdit. I make so:

  QStringList list = line.split(QRegExp("\\s+"));

  for (int i = 0; i < list.count(); i++){
      table.push_back(list[i]);

      this->ui->textEdit->setText(table[i]); //output text in qtextedit
  }

But i see clean textedit after that. But if i make for example:

this->ui->textEdit->setText(table[2]);

I see third word in QTextEdit. What's wrong?

Thank you.

© Stack Overflow or respective owner

Related posts about qt